package Tools;

import Plants.CoalPlant;
import Plants.GasPlant;
import Plants.PowerPlant;
import Plants.SolarPlant;
import Plants.WindTurbine;

/**
 * Factory that produces power plant objects
 * @author jeffrwon
 *
 */
public class PowerPlantFactory {

	/**
	 * Creates a power plant object of type type and name name
	 * @param name
	 * @param type
	 * @return
	 */
	public static PowerPlant getPowerPlant(String name, String type)
	{
		if(type.equalsIgnoreCase("Gas"))
		{
			return new GasPlant(name);
		}
		if(type.equalsIgnoreCase("Wind"))
		{
			return new WindTurbine(name);
		}
		if(type.equalsIgnoreCase("Solar"))
		{
			return new SolarPlant(name);
		}
		if(type.equals("Coal"))
		{
			return new CoalPlant(name);
		}
		return null;
	}
	
}
